<?php
require_once 'propel/validator/BasicValidator.php';

/**
 * A simple validator for email fields.
 * 
 * @package propel.validator
 */
class DateValidator implements BasicValidator
{
	function isValidTimeStamp($timestamp)
	{
    	return ((string) (int) $timestamp === $timestamp) 
        	&& ($timestamp <= PHP_INT_MAX)
        	&& ($timestamp >= ~PHP_INT_MAX);
	}
	
  public function isValid(ValidatorMap $map, $str)
  {
  	$date = strtotime($str);
    return $date || isValidTimeStamp($date);
  }
}

